package Homework.Three;

import Homework.T1;
import Io.FileoutStream;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class Test2 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        File file = new File("./");
        File list[] = file.listFiles(f -> f.getName().endsWith(".obj"));
        for (File lists: list) {
            System.out.println(lists.getName());
            FileInputStream fis = new FileInputStream(lists);
            ObjectInputStream osi = new ObjectInputStream(fis);
            Object obj =  osi.readObject();
            T1User s = (T1User)obj;
            System.out.println(s);
        }
    }
}
